import React, { Component } from 'react';
import { message } from 'antd';
import ProForm, { ProFormTextArea, ProFormText } from '@ant-design/pro-form';
import { saveNotice } from '@/api';
export default class index extends Component {
  render() {
    return (
      <ProForm
        onFinish={async (value) => {
          saveNotice(value).then(res=>{
            if(res.code===200){
              message.success('提交成功');
            }
          })
        }}
        autoFocusFirstInput
      >
        <h2 style={{ textAlign: 'center' }}>公告发布</h2>
        <ProFormText name="title" label="题目" placeholder="请输入题目" required />
        <ProFormText name="publisher" label="发布者" placeholder="请输入名称" required />
        <ProFormTextArea label="正文" name="content" required />
      </ProForm>
    );
  }
}
